import Vue from 'vue'
import App from './App.vue'

import '@/assets/css/reset.css' // 初始化样式

import router from '@/router/index.js' // 导入路由配置

import store from '@/store/index.js' // 导入 vuex

import './element-ui/index.js' // 导入elemen组件库

import './mock/mockServe.js' // 导入mock的模拟数据

import Nav from '@/components/Nav/nav.vue'
import List from '@/views/Home/list.vue'
import Recommended from '@/views/Home/recommended.vue'
import Ranking from '@/views/Home/ranking.vue'
import Like from '@/views/Home/like.vue'
import Floor from '@/views/Home/floor.vue'
import Brand from '@/views/Home/brand.vue'
import Carousel from '@/views/Home/carousel.vue'
import Pagination from '@/components/Pagination/pagination.vue'

Vue.component('Nav', Nav)
Vue.component('List', List)
Vue.component('Recommended', Recommended)
Vue.component('Ranking', Ranking)
Vue.component('Floor', Floor)
Vue.component('Like', Like)
Vue.component('Brand', Brand)
Vue.component('Carousel', Carousel)
Vue.component('Pagination', Pagination)


// import { Carts } from './api/index' // 测试ajax请求是否成功
// Carts({ name: 'ok' })

Vue.config.productionTip = false

new Vue({
  router, // 路由身上有 $router(编程式导航) 属性和 $route(获取路径，query(查询参数)和parmas（关键字）)
  store, // 挂载 vuex
  render: (h) => h(App)
}).$mount('#app')
